/*
*
*/

#include <stdlib.h>
#include <stdio.h>

#define ds_screen_c
#define LUA_LIB

#include "vars.h"

static int screen_waitForVBlank(lua_State *L){
	swiWaitForVBlank();
	return 0;
}

static int screen_print(lua_State *L){
	char * text = (char *)luaL_checkstring(L, 1);
	printf(text);
	return 0;
}

static const luaL_Reg screenlib[] = {
	{"waitForVBlank", screen_waitForVBlank},
	{"print", screen_print},
	{NULL, NULL}
};

/*
** Open infos library
*/
LUALIB_API int luaopen_screen (lua_State *L) {
	luaL_register(L, LUA_SCREENLIBNAME, screenlib);
	return 1;
}
